package com.ecotope.quartz.module.controller;

import com.ecotope.quartz.module.entity.AccessData;
import com.ecotope.quartz.module.service.AccessDataService;
import com.ecotope.quartz.module.service.AtmosphericStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.List;

/**
 * @author JK
 */
@RestController
@RequestMapping("/accessdata")
public class AirqualityAutostationController {


    @Autowired
    private AccessDataService accessDataService;
    @Autowired
    private AtmosphericStationService atmosphericStationService;

    @GetMapping("/list")
    public List<AccessData> list(AccessData accessData) {
        return accessDataService.selectList(accessData);
    }

    @GetMapping("/insertQX")
    public void insertQX() {
        try {
            atmosphericStationService.insertQX();
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

    @GetMapping("/insertPJ")
    public void insertPJ(){
        try {
            atmosphericStationService.insertPJ();
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
